/**
  *@file    DSM.h
  *@brief   Data Structure Management
  *@anthor  zxf 2018-12-21
  *@version V1.0.0
  */
#ifndef __DSM_T_H__
#define __DSM_T_H__
#include "arch_if.h"

/* Exported define ----------------------------------------------------------*/
/* Exported typedef ---------------------------------------------------------*/

//queue
typedef struct
{
    u16 size;
    u16 item;
    u8  unit;
    u8 *start;
    u8 *end;
    u8 *in;
    u8 *out;
}DSM_Q_t;

/* Exported functions -------------------------------------------------------*/

void DSM_QCreate(DSM_Q_t *q, void *array, u16 size, u8 unit);
u32 DSM_QIn(DSM_Q_t *q, void *d);
u32 DSM_QOut(DSM_Q_t *q);
u8 DSM_QIsEmpty(DSM_Q_t *q);
void DSM_Clear(DSM_Q_t *q);

#endif
